// Copyright (c) MatrixFramework. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.Extensions.DependencyInjection;
using MatrixFramework.Keycloak.Extensions;

namespace MatrixFramework.Keycloak;

/// <summary>
/// MatrixFramework.Keycloak模块配置
/// </summary>
public static class MatrixFrameworkKeycloakModule
{
    /// <summary>
    /// 配置MatrixFramework.Keycloak服务
    /// </summary>
    /// <param name="services">服务集合</param>
    /// <returns>服务集合</returns>
    public static IServiceCollection AddMatrixFrameworkKeycloak(this IServiceCollection services)
    {
        // 使用扩展方法注册服务
        return services.AddKeycloakServices();
    }

    /// <summary>
    /// 配置MatrixFramework.Keycloak服务（带配置）
    /// </summary>
    /// <param name="services">服务集合</param>
    /// <param name="configuration">配置</param>
    /// <returns>服务集合</returns>
    public static IServiceCollection AddMatrixFrameworkKeycloak(
        this IServiceCollection services,
        Microsoft.Extensions.Configuration.IConfiguration configuration)
    {
        // 使用扩展方法注册服务
        return services.AddKeycloakServices(configuration);
    }
}